package com.stefanini.pe.bbva.mbl.in.dao;

import java.util.List;

import org.springframework.orm.ibatis.support.SqlMapClientDaoSupport;

import com.stefanini.pe.bbva.mbl.carga.in.to.CargaLogIni;
import com.stefanini.pe.bbva.mbl.in.dao.iface.CargaLogIniDAO;
public class CargaLogIniDAOImpl extends SqlMapClientDaoSupport implements CargaLogIniDAO {

    public CargaLogIniDAOImpl() {
        super();
    }

    public int deleteByPrimaryKey(Long codCargalog) {
        CargaLogIni key = new CargaLogIni();
        int rows = 0;
        
        logger.info("Inicio");
        //cod_cargalog
        key.setCod_cargalog(codCargalog);
        rows = getSqlMapClientTemplate().delete("CARGA_LOG.ibatorgenerated_deleteByPrimaryKey", key);
        
        logger.info("Fin");
        
        return rows;
    }

    public void insert(CargaLogIni record) {
    	logger.info("Inicio");
    	
        getSqlMapClientTemplate().insert("CARGA_LOG.ibatorgenerated_insert", record);
        
        logger.info("Fin");
    }

    public void insertSelective(CargaLogIni record) {
    	logger.info("Inicio");
    	
        getSqlMapClientTemplate().insert("CARGA_LOG.ibatorgenerated_insertSelective", record);
        
        logger.info("Fin");
    }

    public CargaLogIni selectByPrimaryKey(Long codCargalog) {
    	CargaLogIni key = new CargaLogIni();
    	CargaLogIni record = null;
        
        logger.info("Inicio");
        
        key.setCod_cargalog(codCargalog);
        record = (CargaLogIni) getSqlMapClientTemplate().queryForObject("CARGA_LOG.ibatorgenerated_selectByPrimaryKey", key);
        
        logger.info("Fin");
        
        return record;
    }

    public int updateByPrimaryKeySelective(CargaLogIni record) {
    	int rows = 0;
    	
    	logger.info("Inicio");
    	
        rows = getSqlMapClientTemplate().update("CARGA_LOG.ibatorgenerated_updateByPrimaryKeySelective", record);
        
        logger.info("Fin");
        
        return rows;
    }


    public int updateByPrimaryKey(CargaLogIni record) {
    	int rows = 0;
    	
    	logger.info("Inicio");
    	
        rows = getSqlMapClientTemplate().update("CARGA_LOG.ibatorgenerated_updateByPrimaryKey", record);
        
        logger.info("Fin");
        
        return rows;
    }
    
    public List selectByCriteria(CargaLogIni record)  {
    	List records = null;
    	
    	logger.info("Inicio");
    	
    	records = (List) getSqlMapClientTemplate().queryForList("CARGA_LOG_INI.ibatorgenerated_selectByCriteria",record);
        
    	logger.info("Fin");
        
		return records;
	}    
}